import threading
from time import sleep

from loguru import logger


def coding(num):
    for _ in range(num):
        logger.info('coding...')
        sleep(0.2)


def music(count):
    for _ in range(count):
        logger.info('music...')
        sleep(0.2)


if __name__ == '__main__':
    # 创建子线程并指定执行的任务
    coding_thread = threading.Thread(target=coding, args=(3,))
    music_thread = threading.Thread(target=music, kwargs={'count': 3})

    # 启动子线程执行任务
    coding_thread.start()
    music_thread.start()
